/*     */ package dm.jdbc.driver;
/*     */ 
/*     */ import dm.jdbc.dbaccess.DBError;
/*     */ import java.sql.SQLException;
/*     */ import java.sql.Savepoint;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class DmdbSavepoint
/*     */   implements Savepoint
/*     */ {
/*  33 */   private static int s_seedId = 0;
/*     */   
/*  35 */   private boolean releasedFlag = false;
/*     */   
/*     */   private static final int MAX_ID_VALUE = Integer.MAX_VALUE;
/*     */   
/*     */   private static final int INVALID_ID_VALUE = -1;
/*     */   
/*     */   static final int NAMED_SAVEPOINT_TYPE = 2;
/*     */   
/*     */   static final int UNNAMED_SAVEPOINT_TYPE = 1;
/*     */   
/*     */   static final int UNKNOWN_SAVEPOINT_TYPE = 0;
/*     */   
/*  47 */   private int m_id = -1;
/*     */   
/*  49 */   private String m_name = null;
/*     */   
/*  51 */   private int m_type = 0;
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public DmdbSavepoint()
/*     */     throws SQLException
/*     */   {
/*  60 */     this.m_type = 1;
/*  61 */     this.m_id = getNextId();
/*  62 */     this.m_name = null;
/*  63 */     this.releasedFlag = false;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public DmdbSavepoint(String s)
/*     */     throws SQLException
/*     */   {
/*  73 */     this.m_type = 2;
/*  74 */     this.m_id = -1;
/*  75 */     this.m_name = s;
/*  76 */     this.releasedFlag = false;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public int getSavepointId()
/*     */     throws SQLException
/*     */   {
/*  96 */     if (this.m_type == 2) {
/*  97 */       DBError.throwSQLException(6046);
/*     */     }
/*     */     
/* 100 */     return this.m_id;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public String getSavepointName()
/*     */     throws SQLException
/*     */   {
/* 120 */     if (this.m_type == 1) {
/* 121 */       DBError.throwSQLException(6047);
/*     */     }
/*     */     
/* 124 */     return this.m_name;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   int getType()
/*     */   {
/* 137 */     return this.m_type;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   private int getNextId()
/*     */   {
/* 146 */     s_seedId = (s_seedId + 1) % Integer.MAX_VALUE;
/* 147 */     return s_seedId;
/*     */   }
/*     */   
/*     */   void setReleasedFlagTrue() {
/* 151 */     this.releasedFlag = true;
/*     */   }
/*     */   
/*     */   boolean getReleasedFlag() {
/* 155 */     return this.releasedFlag;
/*     */   }
/*     */ }


/* Location:              D:\Program Files\DBMS_20150813\jdbc\Dm7JdbcDriver17.jar!\dm\jdbc\driver\DmdbSavepoint.class
 * Java compiler version: 2 (46.0)
 * JD-Core Version:       0.7.1
 */